﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace LotteryAdmin
{
    public enum LotteryType
    {
        SSC=1,
        _3D=2,
        SSQ=3
    }
    public enum PlayType
    {
        _3xZhix = 1,
        _3xZux = 2,
        _2xZhix = 3,
        _2xZux = 4,
        _H1Zhix = 5,
        _Bddw = 6,
        _Ddw = 7,
        _3DZhix = 8,
        _3DZux = 9,
        _3D2xZhix = 10,
        _3D2xZux = 11,
        _3DH1Zhix = 12,
        _3DBddw = 13,
        _3DDdw = 14,
        _SSQBlue = 15,
        _SSQRed = 16,
        NSSCBdw = 17,
        N3DBdw = 18,
        NSSQBlue = 19,
        NSSQRed = 20
    }
    public class BonusCalc
    {
        public static string GetScale(double MaxScale, double Bonus, int Multiple, LotteryType type)
        {
            if (type == LotteryType.SSC || type == LotteryType._3D)
            {
                if (Multiple == 100)
                    return ((MaxScale - Bonus * 20/Multiple)).ToString("F2");
                else if(Multiple == 10)
                    return ((MaxScale - Bonus * 20/Multiple)).ToString("F1");
                else if (Multiple == 1000)
                    return (MaxScale).ToString("F2");
                else 
                    return ((MaxScale - Bonus * 20/Multiple)).ToString("F0");
            }
            else
            {
                return (MaxScale).ToString("F2");
            }
        }
        public static string GetBonus(double MaxScale,double Bonus, int Multiple,LotteryType type)
        {
            if (type == LotteryType.SSC||type == LotteryType._3D)
            {
                if (Multiple == 100)
                    return ((MaxScale - Bonus * 20 / Multiple) / (2)).ToString("F2");
                else if (Multiple == 10)
                    return ((MaxScale - Bonus * 20 / Multiple) / (2)).ToString("F1");
                else if (Multiple == 1000)
                    return (MaxScale / 2).ToString("F2");
                 else
                    return ((MaxScale - Bonus * 20 / Multiple) / (2)).ToString("F0");
            }
            else
            {
                return (MaxScale / 2).ToString("F2");
            }
        }
    }
}
